﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MSHTML = mshtml;
using Helpers.Conditions;
using Helpers;

namespace HtmlParsing.Helpers.Conditions
{
    public class InputCondition : BaseTagCondition<MSHTML.IHTMLInputElement>
    {
        public string Type { get; set; }

        public override bool IsAccepted(MSHTML.IHTMLInputElement input)
        {
            bool result = base.IsAccepted(input);

            result &= StringHelper.IsnullOrBlank(Type) 
                || input.type.ToUpper() == Type.ToUpper();

            return result;
        }
    }
}
